function(set_arch_flags target arch)
  message(STATUS "Setting architecture flags for ${arch}")
  if(arch MATCHES "x86_64")
    target_compile_options(${target} PRIVATE -mavx2 -mpclmul -mbmi -mlzcnt)
  elseif(arch MATCHES "arm")
    target_compile_options(${target} PRIVATE -march=armv8-a)
  else()
    message(FATAL_ERROR "Unsupported architecture: ${arch}")
  endif()
endfunction()
